package com.csyf.manager.dao;

import com.csyf.manager.entity.SysWithdrawalRecord;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.math.BigDecimal;

/**
 * @Author: casper
 * @Description: 提现记录DAO
 * @Date: Created in 2018/10/27 17:35
 */
@Repository
public interface SysWithdrawalRecordDao extends Mapper<SysWithdrawalRecord> {


    /**
     * 查询指定一天的数据
     * @param srcmch_id
     * @param date
     * @return
     */
    @Select("SELECT IFNULL(SUM(money),0) FROM sys_withdrawal_record WHERE app_id = #{srcmch_id} AND create_time BETWEEN CONCAT(#{date},' 00:00:00') AND CONCAT(#{date},' 23:59:59')")
    BigDecimal queryTotalCase(@Param("srcmch_id") String srcmch_id, @Param("date") String date);


}
